package cn.tx.controller;

import java.util.List;

import cn.tx.model.StoreLog;
import cn.tx.query.StoreLogQuery;
import cn.tx.service.StoreLogService;
import cn.tx.util.Page;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ModelDriven;

public class StoreLogAction extends BaseAction implements ModelDriven<StoreLog>{
	
	private StoreLog storeLog = new StoreLog();
	
	private StoreLogService storeLogService;
	
	
	
	
	public StoreLog getStoreLog() {
		return storeLog;
	}

	public void setStoreLog(StoreLog storeLog) {
		this.storeLog = storeLog;
	}

	/**
	 * 查询对象
	 */
	private StoreLogQuery erpQuery = new StoreLogQuery();
	
	
	public StoreLogService getStoreLogService() {
		return storeLogService;
	}

	public void setStoreLogService(StoreLogService storeLogService) {
		this.storeLogService = storeLogService;
	}
	

	public StoreLogQuery getErpQuery() {
		return erpQuery;
	}

	public void setErpQuery(StoreLogQuery erpQuery) {
		this.erpQuery = erpQuery;
	}

	/**
	 * 查询员工的列表
	 * @return
	 */
	public String storeLog_list(){
		//获得action的容器
		ActionContext context = ActionContext.getContext();
		Page page = storeLogService.selectObjectByConditionPage(erpQuery, exclude);
		context.put("page", page);
		
		return SUCCESS;
	}
	
	/**
	 * 跳转到添加页面
	 * @return
	 */
	public String storeLog_input(){
		
		return SUCCESS;
	}
	/**
	 * 跳转到修改页面
	 * @return
	 */
	public String storeLog_preupdate(){
		storeLog = storeLogService.getObjectById(storeLog.getLogId());
		return SUCCESS;
	}
	/**
	 * 保存
	 * @return
	 */
	public String storeLog_save(){
		storeLogService.save(storeLog);
		return TOLIST;
	}
	/**
	 * 修改
	 * @return
	 */
	public String storeLog_update(){
		storeLogService.update(storeLog);
		return TOLIST;
	}
	/**
	 * 修改
	 * @return
	 */
	public String storeLog_delete(){
		storeLog = storeLogService.getObjectById(storeLog.getLogId());
		storeLogService.delete(storeLog);
		return TOLIST;
	}

	@Override
	public StoreLog getModel() {
		return storeLog;
	}
	
	
	
	

}
